import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Optional;
import java.util.concurrent.*;

public class TestSix {
    public static void main(String[] args) {

        ThreadLocal<Integer> threadLocal = ThreadLocal.withInitial(()->1);

        Thread thread = new Thread(()->{
            System.out.println("1234");
            System.out.println(threadLocal.get());
            Integer a = threadLocal.get();
            threadLocal.set(a+1);
            System.out.println(threadLocal.get());
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            Thread thread1=  new Thread(()->{
                System.out.println("333");
                System.out.println(threadLocal.get());
            });
            thread1.start();
            try {
                thread1.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
        thread.start();
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        ThreadPoolExecutor executor = new ThreadPoolExecutor(3,5,1L, TimeUnit.SECONDS,new ArrayBlockingQueue<>(50),Executors.defaultThreadFactory(),new ThreadPoolExecutor.AbortPolicy());
        executor.getActiveCount();
        ThreadLocal<Integer> threadLocal1 = new ThreadLocal<>();
        Runtime.getRuntime().freeMemory();
        BlockingQueue<Integer> blockingQueue = new LinkedBlockingDeque<>(10);
        ScheduledExecutorService scheduledExecutorService = new ScheduledThreadPoolExecutor(10);
        scheduledExecutorService.schedule(()->{
            System.out.println("111");
        },1L,TimeUnit.SECONDS);
        System.out.println("1116666");
        executor.getActiveCount();
        System.out.println("111133445"+executor.getActiveCount());
Object object = new Object();
     LocalDateTime localDateTime = LocalDateTime.now();


    }
}
